/**
 * 
 */
package com.haisen.lee.domain;

import java.util.HashMap;
import java.util.Map;

import com.haisen.lee.util.FormItemType;

/**
 * @author Haisen Lee
 * 
 */
public class RadioInput extends FormItem {

	private Map<String, RadioItem> radioItems = new HashMap<String, RadioItem>();

	public class RadioItem {

		private String value;
		private String name;
		private boolean checked = false;

		public RadioItem() {
			super();
			this.setName(RadioInput.this.getFormItemName());
		}

		public String getValue() {
			return value;
		}

		public void setValue(String value) {
			this.value = value;
		}

		public String getName() {
			return name;
		}

		public void setName(String name) {
			this.name = name;
		}

		public boolean isChecked() {
			return checked;
		}

		public void setChecked(boolean checked) {
			this.checked = checked;
		}

	}

	/**
	 * 
	 */
	public RadioInput() {
		super();
		this.setFormItemType(FormItemType.radio);
	}

	/**
	 * @param radioItems
	 *            the radioItems to set
	 */
	public void setRadioItems(Map<String, RadioItem> radioItems) {
		this.radioItems = radioItems;
	}

	/**
	 * @return the radioItems
	 */
	public Map<String, RadioItem> getRadioItems() {
		return radioItems;
	}

}
